package com.localjoycommunity.cpdj.project.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.localjoycommunity.cpdj.project.system.domain.UserCourseWatch;
import com.localjoycommunity.cpdj.project.system.domain.vo.UserCourseWatchVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: lida
 * @Date: 2020/12/15 0015 上午 10:21
 * @Description:
 */
public interface UserCourseWatchMapper extends BaseMapper<UserCourseWatch> {

    /**
     * 查询
     *
     * @param id ID
     * @return
     */
    public UserCourseWatch selectUserCourseWatchById(Long id);

    /**
     * 用户学习记录
     *
     * @param userCourseWatch
     * @return 集合
     */
    public List<UserCourseWatch> selectUserCourseWatchList(UserCourseWatch userCourseWatch);

    UserCourseWatch selectUserCourseWatch(@Param("courseId") Long courseId,@Param("userId") Integer userId);

    /**
     * 用户学习记录最近学习时间倒序排序)
     *
     * @param userCourseWatchVo
     * @return 集合
     */
    UserCourseWatch selectByUpdateTimeDesc(UserCourseWatchVo userCourseWatchVo);

    /**
     * 用户学习历史
     *
     * @param userCourseWatchVo
     * @return 集合
     */
    public List<UserCourseWatchVo> selectUserCourseWatchListHistory(UserCourseWatchVo userCourseWatchVo);

    /**
     * 新增
     *
     * @param userCourseWatch
     * @return 结果
     */
    public int insertUserCourseWatch(UserCourseWatch userCourseWatch);

    /**
     * 修改
     *
     * @param userCourseWatch
     * @return 结果
     */
    public int updateUserCourseWatch(UserCourseWatch userCourseWatch);

    /**
     * 删除
     *
     * @param id ID
     * @return 结果
     */
    public int deleteUserCourseWatchById(Long id);

    /**
     * 批量删除
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteUserCourseWatchByIds(Long[] ids);
}
